﻿// ***********************************************************************
// Assembly         : MVC4Portal
// Author           : LJO+01 (Laurent Jordi)
// Created          : 06-05-2013
// Last Modified By : LJO+01 (Laurent Jordi)
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="BundleConfig.cs" company="Copyright © Innovacall 2011">
//     Copyright (c) Copyright © Innovacall 2011. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using InnovaApp.Portals.MVC4Portal.Controllers;
using System.Configuration;
using System.Web.Optimization;

namespace InnovaApp.Portals.MVC4Portal
{
    /// <summary>
    /// Class BundleConfig
    /// </summary>
    public class BundleConfig
    {
        /// <summary>
        /// Registers the bundles.
        /// </summary>
        /// <param name="bundles">The bundles.</param>
        public static void RegisterBundles(BundleCollection bundles)
        {
            string JQueryUITheme = PortalEnvironment.JQueryUITheme;
            string KendoUITheme = PortalEnvironment.KendoUITheme;

            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/JQuery/jquery-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/views").Include(
                        "~/Scripts/views/_layout.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
                        "~/Scripts/JQuery/jquery-ui-{version}.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryplugins").Include(
                        "~/Scripts/JQuery/plugins/*.js"));

            bundles.Add(new ScriptBundle("~/bundles/jqueryballoon").Include(
                        "~/Scripts/ClientComponents/Balloons/jqueryballoon.js"));

            bundles.Add(new ScriptBundle("~/bundles/datejs").Include(
                        "~/Scripts/ClientComponents/datejs/date.js"));

            bundles.Add(new ScriptBundle("~/bundles/kendoui").Include(
                        "~/Scripts/KendoUI/kendo.web.js"));

            bundles.Add(
                new ScriptBundle("~/bundles/jqueryval").Include
                (
                    "~/Scripts/Validation/jquery.validate*",
                    "~/Scripts/Validation/jquery.unobtrusive*",
                    "~/Scripts/Validation/additional-methods.js"
                )
            );

            // Utilisez la version de développement de Modernizr pour développer et apprendre. Puis, lorsque vous êtes
            // prêt pour la production, utilisez l’outil de génération sur http://modernizr.com pour sélectionner uniquement les tests dont vous avez besoin.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
                        "~/Scripts/Modernizer/modernizr-*"));

            bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

            bundles.Add(new StyleBundle("~/Content/ClientComponents/boxshadow/css").Include(
                        "~/Content/ClientComponents/boxShadow/boxshadow.css"));

            //bundles.Add(new StyleBundle("~/Content/themes/css").Include(
            //            "~/Content/themes/base/*.css"));

            //if (JQueryUITheme.ToLower() != "base")
            //{
            //    string StyleBundleBase = string.Format(@"~/Content/themes/{0}", JQueryUITheme);

            //    bundles.Add(new StyleBundle(string.Format(@"{0}", StyleBundleBase)).Include(
            //    string.Format(@"~/Content/themes/{0}/*.css", JQueryUITheme)));
            //}
            bundles.Add(
                new StyleBundle("~/Content/ClientComponents/KendoUI/css").Include
                (
                    "~/Content/ClientComponents/KendoUI/kendo.common.css"
                )
            );
#if DEBUG
            BundleTable.EnableOptimizations = false;
#else
                BundleTable.EnableOptimizations = true;
#endif
        }
    }
}